package com.easy.mapper;
import com.easy.bean.Schedule;
import com.easy.util.Page;
import com.easy.vo.ScheduleWithDoctorVO;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface ScheduleMapper {
    int add(Schedule schedule);

    int del(@Param("id") Integer id);

    int edit(Schedule schedule);

    List<Schedule> all(Schedule schedule);

    Schedule one(@Param("id") Integer id);

    int count(Schedule schedule);

    List<Schedule> page(@Param("schedule") Schedule schedule, @Param("page") Page page);

    @MapKey("time_slot")
    List<Map<String, Object>> allTimeSlot(Schedule schedule);

    int decrement_remaining(@Param("id") Integer id);

    int increment_remaining(@Param("id") Integer id);

    int update_is_deleted(@Param("id") Integer id, @Param("is_deleted") Integer is_deleted);

    List<ScheduleWithDoctorVO> pageWithDoctor(@Param("sch") Schedule sch,
                                              @Param("page") Page page);
    int countWithDoctor(@Param("sch") Schedule sch);

}